<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/7/2
 * 代驾模型
 * Time: 13:52
 */

namespace App\Models;


use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class DrivingTariff extends Model
{
    use SoftDeletes;
   protected $table = 'driving_tariff';

    protected $casts = [
        'basics' => 'array',
        'mileage' => 'array',
        'duration' => 'array',
        'distance' => 'array',
        'waiting_timeout' => 'array',
        'other_settings' => 'array',
        'starting_price' => 'array'

    ];
    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     * 关联公司
     */
    function company()
    {
        return $this->hasOne(Company::class,'id','company_id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     * 业务类型
     */
    function service_type()
    {
        return $this->hasOne(ServiceType::class,'id','service_type_id');
    }
}